package action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import pageModel.Json;
import pageModel.SaleReturnItem;
import service.SaleReturnItemServiceI;

import com.opensymphony.xwork2.ModelDriven;

@Namespace("/")
@Action(value="saleReturnItemAction")
public class SaleReturnItemAction extends BaseAction implements ModelDriven<SaleReturnItem>{
SaleReturnItem saleReturnItem = new SaleReturnItem();
private SaleReturnItemServiceI saleReturnItemService;

	public SaleReturnItemServiceI getSaleReturnItemService() {
	return saleReturnItemService;
}
@Autowired
public void setSaleReturnItemService(SaleReturnItemServiceI saleReturnItemService) {
	this.saleReturnItemService = saleReturnItemService;
}
	public SaleReturnItem getModel() {
		return saleReturnItem;
	}
public void save(){
	Json j = new Json();
	saleReturnItemService.save(saleReturnItem);
	j.setSuccess(true);
}
public void datagrid(){
	super.writeJson(saleReturnItemService.datagrid(saleReturnItem));
}
}
